From 42ca90ee1f0aadaa09888f1c9627657abcd866b2 Mon Sep 17 00:00:00 2001 From: IwanIDev Date: Sat, 21 Mar 2026 15:43:12 +0000 Subject: feat: implement PostHeader component and add blog post route --- src/pages/posts/[...slug].astro | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/pages/posts/[...slug].astro (limited to 'src/pages/posts/[...slug].astro') diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro new file mode 100644 index 0000000..b68f153 --- /dev/null +++ b/src/pages/posts/[...slug].astro @@ -0,0 +1,42 @@ +--- +import { getCollection, type CollectionEntry } from "astro:content"; +import Layout from "@/layouts/main.astro"; +import { buttonVariants } from "@/components/ui/button"; +import PostHeader from "@/components/PostHeader.astro"; + +export async function getStaticPaths() { + const posts = await getCollection("blog"); + + return posts.map((post) => ({ + params: { slug: post.id }, + props: { post }, + })); +} + +interface Props { + post: CollectionEntry<"blog">; +} + +const { post } = Astro.props as Props; +const { Content } = await post.render(); +--- + + +
+ + +
+ +
+ +
+ Back to posts +
+
+
-- cgit